Skip to content

feat(reporter): HTML report format + CLI --format html#73

Merged
sepehr-safari merged 1 commit into
mainfrom
feat/reporter-html
Jul 8, 2026
Merged

feat(reporter): HTML report format + CLI --format html#73
sepehr-safari merged 1 commit into
mainfrom
feat/reporter-html

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

Summary

Implements GitHub Issue #62: HTML report format + CLI --format html.

Adds a self-contained HTML report generator (generateHtmlReport) that mirrors the existing Markdown reporter's sections — session overview, timeline summary, failures, suggested next steps, and event appendix — with clean dark-theme inline CSS and no external dependencies.

Changes

  • packages/toolkit/src/reporter/html.ts (new): generateHtmlReport(result: AnalysisResult): string — returns a complete <!DOCTYPE html> document with inline CSS. All user-supplied content (event payloads, descriptions, metadata) is escaped via escapeHtml() to prevent XSS / injection.
  • packages/toolkit/src/reporter/html.test.ts (new): 11 tests covering:
    • Non-empty HTML string containing <html and </html>
    • Section headers present (Session Overview, Failures, etc.)
    • Zero-failures and with-failures cases
    • HTML escaping: <script>&lt;script&gt; in failure descriptions and metadata
    • Self-contained document (no external src/href/<link>/<script src>)
  • packages/toolkit/src/reporter/index.ts (modified): added export { generateHtmlReport } from './html.js';
  • packages/toolkit/src/cli/commands/report.ts (modified): imports generateHtmlReport; dispatches to it when --format html is passed, otherwise uses generateMarkdownReport as before.

Verification

Check Result
pnpm test ✅ 280 tests passed (13 files), including 11 new HTML report tests
pnpm typecheck ✅ 3/3 tasks successful (toolkit build + typecheck, web typecheck)
pnpm lint ✅ No errors in changed files (38 pre-existing errors in unrelated replay/engine.test.ts)
pnpm format ✅ All files formatted
pnpm format:check ✅ All matched files use Prettier code style

Closes #62

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ocpp-debugkit-web Ready Ready Preview, Comment Jul 8, 2026 5:42pm

@sepehr-safari sepehr-safari merged commit 3f1819e into main Jul 8, 2026
4 checks passed
@sepehr-safari sepehr-safari deleted the feat/reporter-html branch July 8, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(reporter): HTML report format + CLI --format html

1 participant